package com.syni.mdd.yhd.common.all.dao.jpa;

import com.syni.mdd.yhd.common.all.dao.BaseJPADao;
import com.syni.mdd.yhd.common.all.entity.BmsSearchLog;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
public interface BmsSearchLogDao extends BaseJPADao<BmsSearchLog,Integer> {

    @Query(value="select * from bms_search_log bsl where  bsl.user_id=?1 group by search_content",nativeQuery=true)
    List<BmsSearchLog> findUserNewsSearchLog(Integer userId,Pageable pageable);

    List<BmsSearchLog> findByUserId(Integer userId);

    List<BmsSearchLog> findByUserIdAndRecordType(Integer userId,Integer recordType,Pageable pageable);
}
